#include "UdpServer.hpp"
#include <memory>

void Usage(std::string proc)
{
    // std::cout << "\n[Usage]\n" << "\t" << proc << "\tlocalip\tlocalport\n" << std::endl;
    std::cout << "\n[Usage]\n\t" << proc << "\tlocalport\n" << std::endl;
    exit(USAGE_ERR);
}

int main(int argc, char* argv[])
{
    if(argc < 2)
    {
        Usage(argv[0]);
    }

    uint16_t port = atoi(argv[1]);
    std::unique_ptr<UdpServer> us(new UdpServer(port));
    us->init();
    us->start();
    return 0;
}